package com.chaoyi.service.Impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.chaoyi.dao.mysql.DictionaryMapper;
import com.chaoyi.model.Dictionary;
import com.chaoyi.service.DictionaryService;

@Service
public class DictionaryServiceImpl implements DictionaryService{

	@Resource
	private DictionaryMapper dictionaryMapper;
	
	@Override
	public List<Dictionary> findList(String offset, String limit) {
		return dictionaryMapper.findList(offset,limit);
	}

	@Override
	public int checkDictionaryName(String dictionaryName, int dicId) {
		return dictionaryMapper.checkDictionaryName(dictionaryName, dicId);
	}

	@Override
	public int saveDictionaryParent(Dictionary dictionary) {
		return dictionaryMapper.saveDictionaryParent(dictionary);
	}

	@Override
	public int saveDictionaryChile(Dictionary dictionary) {
		return dictionaryMapper.saveDictionaryChile(dictionary);
	}

	@Override
	public List<Dictionary> findChildrenList(int parentId) {
		return dictionaryMapper.findChildrenList(parentId);
	}
	
}
